function main(defaultParams, event) {
    var self = this; // 重置作用域
    var tableComp = self.$$element("table_922vf1"); // 获取表格元素
    let vehicleIdValue = defaultParams["9a3f25c9-e3c8-4f0c-bb28-37b1985e4234"];
    let humanIdValue = defaultParams["ddb46540-2ad4-44a4-9188-4f7901670f8e"];
    let vehicleHumanData = {
        vehicleId: vehicleIdValue,
        vehicleLicenseNumber: "",
        humanId: humanIdValue,
        humanName: ""
    };
    self.$$confirm({
        content: "确定取消绑定？",
        type: "danger",  // danger info warning
        headerTitle: "告警", //确认框头部标题 提示、警告、告警
        showOkBtn: true, // 是否展示确认按钮
        showCancelBtn: true, // 是否展示取消按钮
        cancelText: "取消", //取消按钮 展示文字
        okText: "确定",  //确认按钮 展示文字
        onOk: () => {
            console.log(event);
            tableComp.loading = true; // 使表格置于loading状态
            // 调用api的删除方法，第一个参数为待删除的实体id，第二个参数为删除条件、指定实体中的列名和列的值
            api.ENTITY_DELETE("t_acd9ea5806fe4ffdb76ee1a1ecb05666",
                { vehicle_info_id: defaultParams["f_3c36b19d33134da6aecaa31cf415854a"] }).then((res) => {
                // then() 为调用成功的回调
                console.log(res);
                insertLawVehicleHumanBindRecord(vehicleHumanData);
                self.$message.success("解除绑定成功！");
                tableComp.loading = false; // 将表格置为非loading状态
                tableComp.onRefresh(); // 调用表格的数据刷新动作
            }).catch(err => {
                self.$message.error(err.message); // 显示错误提示信息
                tableComp.loading = false; // 将表格置为非loading状态
            });
            api.EXEC_FORMULA("UPDATE('t_baed510846ce488d91e5eab35ed13bc0', QUERY_EQ('id'," + defaultParams.id.value + "), '', ['human_flag', 0 ])").then((res) => {
                // then() 为调用成功的回调
                console.log("res", res);
                //刷新表格


            }).catch(err => {
                self.$message.error(err.message); // 显示错误提示信息
            });
        },
        onCancel: () => {
            return
        }
    });
}

/**
 * 绑定
 * law_vehicle_human_bind_record
 *
 */
function insertLawVehicleHumanBindRecord(vehicleHumanData) {

    const insertFields = [
        ['vehicle_info_id', vehicleHumanData.vehicleId],
        ['vehicle_license_number', `'${vehicleHumanData.vehicleLicenseNumber}'`],
        ['human_id', vehicleHumanData.humanId],
        ['human_name', `'${vehicleHumanData.humanName}'`],
        ['operator_human_id', 'USER_ID()'],
        ['operator_human_name', 'USER_NAME()'],
        ['operator_type_id', `'2'`],
        ['operator_type_name', `'解绑'`],
        ['operator_time', 'NOW()']
    ];

    const formattedFields = insertFields.map(([key, value]) => {
        return `'${key}',${value}`;
    });

    const law_vehicle_human_bind_record = "ds_tbl:t_cac31c58737b421c95fa4070f0e2d8c8";
    const insertSql = `INSERT('${law_vehicle_human_bind_record}', [${formattedFields.join(',')}])`;

    console.log(insertSql);

    api.EXEC_FORMULA(insertSql).then(res => {
        console.log(res)
    })
}
